package com.promise.jokerdream.response.pc

import com.promise.jokerdream.model.ScratchAwardModel
import com.promise.jokerdream.model.ScratchCardTaskModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

// 查询刮刮卡任务信息
@Serializable
data class QueryScratchCardPCResponse(
    override val result: Int,
    override val msg: String = "",
    // 刮刮卡数量
    val cardNum: Int,
    // 任务列表
    @SerialName("active_info")
    val task: List<ScratchCardTaskModel> = emptyList()
): BasePCResponse {
    override fun getDescription(): String {
        return msg
    }
}

// 刮卡结果
@Serializable
data class ScratchCardPCResponse(
    override val result: Int,
    override val msg: String = "",
    val awardInfo: List<ScratchAwardModel> = emptyList()
) : BasePCResponse {
    override fun getDescription(): String {
        if (result == 0) {
            val model = awardInfo.first()
            return "恭喜您刮出了${model.goodsName}*${model.num}"
        } else {
            return msg
        }
    }
}
